//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.golang.api.util;

public class ResultGenerator {
    /** @deprecated */
    @Deprecated
    private static final String DEFAULT_SUCCESS_MESSAGE = "SUCCESS";
    /** @deprecated */
    @Deprecated
    public static final int ILLEGAL_ARGUMENT_CODE = 100;
    /** @deprecated */
    @Deprecated
    public static final String ILLEGAL_ARGUMENT_MESSAGE = "参数非法";
    /** @deprecated */
    @Deprecated
    public static final int TIME_OUT_CODE = 110;
    /** @deprecated */
    @Deprecated
    public static final String TIME_OUT_MESSAGE = "安全认证失败，时间过期";
    /** @deprecated */
    @Deprecated
    public static final int SECURE_FAIL_CODE = 120;
    /** @deprecated */
    @Deprecated
    public static final String SECURE_FAIL_MESSAGE = "安全认证失败，签名错误";
    /** @deprecated */
    @Deprecated
    public static final int SUCCESS_CODE = 200;
    /** @deprecated */
    @Deprecated
    public static final String SUCCESS_MESSAGE = "OK";
    /** @deprecated */
    @Deprecated
    public static final int ERROR_CODE = 500;
    /** @deprecated */
    @Deprecated
    public static final String ERROR_MESSAGE = "抱歉，系统出现异常，请稍后再试";

    public ResultGenerator() {
    }

    public static <T> Result<T> success() {
        return new Result(CommonRespCode.SUCCESS);
    }

    public static <T> Result<T> success(T result) {
        return new Result(CommonRespCode.SUCCESS, result);
    }

    public static <T> Result<T> error() {
        return new Result(CommonRespCode.ERROR);
    }

    public static <T> Result<T> error(String message) {
        return new Result(CommonRespCode.ERROR.getCode(), message);
    }

    public static <T> Result<T> result(StatusEnumSupport statusEnumSupport) {
        return new Result(statusEnumSupport);
    }

    /** @deprecated */
    @Deprecated
    public static <T> Result<T> result(StatusEnumSupport statusEnumSupport, T result) {
        return new Result(statusEnumSupport, result);
    }

    public static <T> Result<T> result(Integer code, String message) {
        return new Result(code, message);
    }

    public static <T> Result<T> result(Integer code, String message, T result) {
        return new Result(code, message, result);
    }

    /** @deprecated */
    @Deprecated
    public static <T> Result<T> ok() {
        return new Result(ResultEnum.OK);
    }

    /** @deprecated */
    @Deprecated
    public static <T> Result<T> ok(T result) {
        return new Result(ResultEnum.OK, result);
    }

    public static <T> Result<T> failure() {
        return new Result(CommonRespCode.FAILURE);
    }

    /** @deprecated */
    @Deprecated
    public static <T> Result<T> failure(T result) {
        return new Result(ResultEnum.ERROR, result);
    }

    /** @deprecated */
    @Deprecated
    public static <T> Result<T> failure(Integer code, String message) {
        return new Result(code, message);
    }

    public static <T> Result<T> wrapper(boolean b) {
        return b ? success() : failure();
    }
}
